package io.jt808.proto.item;


import io.norland.buffer.AutoBuffer;
import io.norland.proto.IProto;

public class PositionAdditional2BAnalog implements IProto {
    private int analog;

    public byte[] writeToBytes() {
        AutoBuffer buffer = new AutoBuffer();
        buffer.writeInt(this.analog);
        return buffer.array();
    }

    public void readFromBuf(AutoBuffer buffer) {
        this.analog = buffer.readInt();
    }

    public int getAnalog() {
        return this.analog;
    }

    public void setAnalog(int analog) {
        this.analog = analog;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof PositionAdditional2BAnalog)) return false;
        PositionAdditional2BAnalog other = (PositionAdditional2BAnalog) o;
        if (!other.canEqual(this)) return false;
        return getAnalog() == other.getAnalog();
    }

    protected boolean canEqual(Object other) {
        return other instanceof PositionAdditional2BAnalog;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        return result * 59 + getAnalog();
    }

    public String toString() {
        return "PositionAdditional2BAnalog(analog=" + getAnalog() + ")";
    }
}